﻿{% extends 'wap/base.html' %}

{% load humanize %}
{% block title %}
{{archive.title}}
{% endblock %}
{% block content %}
<h4>{{archive.title}}</h4>
<div class='info'>
    分类:<a href='/wap{{archive.category.get_absolute_url}}'>{{archive.category.name}}</a><br/>{{archive.pub_date|naturalday}} {{archive.pub_date|date:"H:i"}}
</div>
{% autoescape off %}
{{archive.content|removetags:'img'}}
{% autoescape on %}
{% endautoescape %}
{% endautoescape %}
<div id='comments' class='section'>
    <h3>Comments</h3>
    {% for comment in archive.query_comments %}
        <div class='comment'>
            <div class='info'>
                <span class='author'>{{comment.name}}</span>
                {% ifequal comment.source 'wap' %}
                <span style='font-style:italic'> -- 通过手机</span>
                {% endifequal %}
            </div>
            <div class='date'>
                <span>{{comment.date|naturalday}} {{comment.date|date:"H:i"}}</span>
            </div>
                <p class='para'>
                    {{comment.content}}
                </p>
            </div>
        </div>
    {% endfor %}
</div>
<div id='add_comment' class='section'>
    <h3>留个小言吧</h3>
    <form method='post' action='/wap/archive/{{archive.key.id}}/comment'>
        <p>
        <label for='id_name'  type='text'>名字</label>
        <input type='text' name='name'></input>
        </p><p>
        <label for='id_content'>内容</label>
        <textarea name='content' id='id_content'></textarea>
        </p>
        <input type='submit' value='留上去'></input>
    </form>
</div><!-- #add_comment -->

{% endblock %}
